package com.qfhd.soft.cjzcore.UI.Base;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;

import androidx.appcompat.app.AppCompatActivity;

import com.jaeger.library.StatusBarUtil;
import com.qfhd.soft.cjzcore.R;
import com.qfhd.soft.cjzcore.UI.Core.CJActivityManager;

public class BaseActivity extends AppCompatActivity {

    public Handler myHandler = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            getMessage(msg);
            super.handleMessage(msg);
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        CJActivityManager.getInstance().addActivity(this);
        //这里做了两件事情，1.使状态栏透明并使contentView填充到状态栏 2.预留出状态栏的位置，防止界面上的控件离顶部靠的太近。这样就可以实现开头说的第二种情况的沉浸式状态栏了
        StatusBarUtil.setTransparent(this);
    }


    public void back(){
        finish();
        overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
    }

    public void getMessage(Message msg){

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        CJActivityManager.getInstance().removeActivity(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
//        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
//        MobclickAgent.onPause(this);
    }
}
